/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.tom.social.common.agent.behaviour;

import jade.core.behaviours.CyclicBehaviour;
import jade.lang.acl.ACLMessage;

/**
 *
 * @author Tom
 */
public class CancelBehaviour extends CyclicBehaviour {

	@Override
	public void action() {
		ACLMessage msg = myAgent.blockingReceive(5000);
		if(msg != null && msg.getPerformative() == ACLMessage.CANCEL) {
			myAgent.doDelete();
		}
	}

}
